<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <title>Supervisor - Search Customer</title>
        <link href="style.css" rel="stylesheet" type="text/css"></link>
        <div style="text-align: center;"><h:graphicImage url="/Images/back.png"></h:graphicImage></div>

    </h:head>
    <h:body>
        <h:form prependId="false">
            <div id="wrapper">
                <div id="logo">

                </div>
                <div id="header">
                    <!-- 		<div id="menu">
                    
                            </div>    -->
                </div>
                <div class="page">
                    <div id="page-bgtop">

                        <div id="dummy"></div>
                        <p:panel id="panelsidebar" header="Pages Menu">
                           
                            <ui:include src="MenuSupervisor.xhtml"/>
                        </p:panel>

                        <!-- end #sidebar -->

                        <div id="content">
                            <p:panel header="Search Customer" id="panelx">
                                <p:dataTable id="dtable" var="customer" value="#{supervisorbean.customers}" paginator="true" rows="10"
                                             selection="#{supervisorbean.customer}" selectionMode="single"
                                             onRowSelectUpdate="display" >

                                    <f:facet name="header">
                                        List of Customers
                                    </f:facet>
                                    <p:column sortBy="#{customer.TC_ID}" filterBy="#{customer.TC_ID}">
                                        <f:facet name="header">
                                            <h:outputText value="ID" />
                                        </f:facet>
                                        <h:outputText value="#{customer.TC_ID}" />
                                    </p:column>
                                    <p:column sortBy="#{customer.name}" filterBy="#{customer.name}">
                                        <f:facet name="header">
                                            <h:outputText value="Name" />
                                        </f:facet>
                                        <h:outputText value="#{customer.name}" />
                                    </p:column>

                                    <p:column sortBy="#{customer.surname}" filterBy="#{customer.surname}">
                                        <f:facet name="header">
                                            <h:outputText value="Surname" />
                                        </f:facet>
                                        <h:outputText value="#{customer.surname}" />
                                    </p:column>

                                    <p:column sortBy="#{customer.addressProvince}" filterBy="#{customer.addressProvince}">  
                                        <f:facet name="header">  
                                            <h:outputText value="Province" />  
                                        </f:facet>  
                                        <h:outputText value="#{customer.addressProvince}" />  
                                    </p:column> 

                                    <p:column sortBy="#{customer.addressDistrict}" filterBy="#{customer.addressDistrict}">  
                                        <f:facet name="header">  
                                            <h:outputText value="District" />  
                                        </f:facet>  
                                        <h:outputText value="#{customer.addressDistrict}" />  
                                    </p:column>
                                    

                                 

                                </p:dataTable>
                                <p:commandButton value="Export as PDF" ajax="false" >
                                    <p:dataExporter type="pdf" target="dtable" fileName="customers" encoding="ISO-8859-9"/>
                                </p:commandButton>

                            </p:panel>

                        </div>
                        <!-- end #content -->

                        <div style="clear: both;">&nbsp;</div>
                    </div>

                    <!-- end #page -->

                </div>
                <div id="footer-bgcontent">
                    <div id="footer" align="center">
                        <p>İstanbul Teknik Üniversitesi - Software Engineering Course - Real Estate Management</p>
                    </div>
                </div>
                <!-- end #footer -->
            </div>

        </h:form>
    </h:body>
</html>